package twentytwenty;

/**
 * @Author: Zahi
 * @Description:
 * @Date Created in 2020-12-16 12:57
 * @Modified By:
 */
public class ArrangeCoins_441 {
    public static void main(String [] args){

    }

    public static int arrangeCoins(int n){
        int first = 1;
        int count = 0;
        while (n > 0){
            n -= first;
            first++;
            if (n >= first){
                count++;
            }
        }
        return count;
    }
}
